Java Interview Preparation Guide
1. Core Java Fundamentals
OOP Concepts ⭐⭐⭐
- Encapsulation, Inheritance, Polymorphism, Abstraction
- Method overloading vs overriding
- Abstract classes vs Interfaces
- Access modifiers (private, protected, public, default)
- Static vs non-static members
- Final keyword usage
Java Memory Management ⭐⭐⭐
- Heap vs Stack memory
- Garbage Collection (GC) types and algorithms
- Memory leaks and prevention
- String pool and intern() method
- OutOfMemoryError scenarios
Exception Handling ⭐⭐⭐
- Checked vs Unchecked exceptions
- Try-catch-finally blocks
- Custom exceptions
- Exception propagation
- Best practices for exception handling
2. Collections Framework ⭐⭐⭐
Must Know Collections
- List: ArrayList, LinkedList, Vector
- Set: HashSet, LinkedHashSet, TreeSet
- Map: HashMap, LinkedHashMap, TreeMap, ConcurrentHashMap
- Queue: PriorityQueue, ArrayDeque
Key Concepts
- Time complexity of operations
- When to use which collection
- Difference between HashMap and HashTable
- ConcurrentHashMap internal working
- Comparable vs Comparator
3. Multithreading & Concurrency ⭐⭐⭐
Threading Basics
- Thread creation (Runnable vs Thread)
- Thread lifecycle and states
- Synchronization (synchronized keyword)
- Wait, notify, notifyAll methods
- Deadlock, race conditions
Advanced Concurrency
- ExecutorService and Thread pools
- Callable and Future
- CountDownLatch, CyclicBarrier, Semaphore
- Atomic classes (AtomicInteger, AtomicReference)
- Concurrent collections (ConcurrentHashMap, BlockingQueue)
4. Java 8+ Features ⭐⭐⭐
Lambda Expressions & Functional Interfaces
- Syntax and usage
- Built-in functional interfaces (Predicate, Function, Consumer, Supplier)
- Method references
Stream API (Already covered in your code)
- Intermediate vs Terminal operations
- Parallel streams
- Collectors class
Optional Class
- Purpose and usage
- Methods: isPresent(), ifPresent(), orElse(), orElseGet()
Other Java 8+ Features
- Default and static methods in interfaces
- Date Time API (LocalDate, LocalDateTime)
- CompletableFuture
5. Spring Framework ⭐⭐⭐
Core Spring
- Dependency Injection (DI) and Inversion of Control (IoC)
- Bean lifecycle and scopes
- ApplicationContext vs BeanFactory
- Annotations: @Component, @Service, @Repository, @Controller
Spring Boot
- Auto-configuration
- Starters and dependencies
- Application properties
- Embedded servers
Spring MVC
- DispatcherServlet
- Controllers and RequestMapping
- ModelAndView
- REST APIs (@RestController, @RequestMapping, @GetMapping)
Spring Data JPA
- Repository pattern
- JPA annotations
- Query methods
- Custom queries
6. Database & JPA ⭐⭐
JDBC
- Connection management
- PreparedStatement vs Statement
- Transaction management
JPA/Hibernate
- Entity mapping (@Entity, @Table, @Id)
- Relationships (@OneToMany, @ManyToOne, @ManyToMany)
- Lazy vs Eager loading
- N+1 problem and solutions
- First and Second level cache
7. Design Patterns ⭐⭐
Must Know Patterns
- Singleton (different implementations, thread safety)
- Factory and Abstract Factory
- Observer pattern
- Strategy pattern
- Decorator pattern
- Builder pattern
Spring Specific Patterns
- Dependency Injection
- Template Method (JdbcTemplate, RestTemplate)
- Proxy pattern (AOP)
8. System Design & Architecture ⭐⭐
Microservices
- Microservices vs Monolithic architecture
- Service discovery
- API Gateway
- Circuit breaker pattern
Caching
- Types of caching (in-memory, distributed)
- Redis, Ehcache
- Cache eviction strategies
Message Queues